#ifndef COURSE_SELECTION_H
#define COURSE_SELECTION_H

#include <string>
#include <iostream>

class CourseSelection {
private:
    std::string studentId;  // 学生学号
    std::string courseId;   // 课程编号
    std::string semester;   // 学期
    double score;           // 成绩

public:
    // 构造函数
    CourseSelection() = default;
    CourseSelection(const std::string& studentId, const std::string& courseId, 
                    const std::string& semester, double score = 0.0);
    
    // 获取选课信息
    std::string getStudentId() const;
    std::string getCourseId() const;
    std::string getSemester() const;
    double getScore() const;
    
    // 设置选课信息
    void setStudentId(const std::string& studentId);
    void setCourseId(const std::string& courseId);
    void setSemester(const std::string& semester);
    void setScore(double score);
    
    // 输入输出操作
    friend std::ostream& operator<<(std::ostream& os, const CourseSelection& selection);
    friend std::istream& operator>>(std::istream& is, CourseSelection& selection);
    
    // 比较操作符，用于排序和查找
    bool operator==(const CourseSelection& other) const;
};

#endif // COURSE_SELECTION_H